import {createContext, Dispatch, ReactElement, SetStateAction, useContext, useState} from "react";


export const DndDemo1Context = createContext<[string | undefined, Dispatch<SetStateAction<string | undefined>>]>([undefined, () => {
}]);

export const DndDemo1Provider = (props: { children: ReactElement }) => {
    const [text, setText] = useState<string>()
    return (
        <DndDemo1Context.Provider value={[text, setText]}>
            {props.children}
        </DndDemo1Context.Provider>
    )
}

export const useDndDemo1 = () => {
    return useContext(DndDemo1Context)
}

export default DndDemo1Provider;
